﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace JumpingMan
{
    partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }
        //public void CreateLabelsForResultName1(ListofPlayer listofplayers)
        //{
        //    int counter = 0;
        //    foreach (Player player in listofplayers.players)
        //    {
        //        string str = "";
        //        Label label = new Label();
        //        str += player.minutes.ToString();
        //        str += ":";
        //        if (player.seconds > 10)
        //        {
        //            str += "0";
        //        }
        //        str += player.seconds.ToString();
        //        label.Text = str;
        //        label.Location = new Point(112, 40 + counter);
        //        label.Font = new Font("Diogenes", 12);
        //        Controls.Add(label);
        //        counter += 20;
        //    }
               
        //}
        public void NameingLabels(ListofPlayer listofplayers)
        {
            for (int i = 0; i < listofplayers.players.Count; i++)
            {
                if (i == 0)
                {
                    label1PlayerName.Text = listofplayers.players[i].namn;
                }
                if (i == 1)
                {
                    label2Playername.Text = listofplayers.players[i].namn;
                }
                if (i == 2)
                {
                    label3Playername.Text = listofplayers.players[i].namn;
                }
                if (i == 3)
                {
                    label4Playername.Text = listofplayers.players[i].namn;
                }
                if (i == 4)
                {
                    label5Playername.Text = listofplayers.players[i].namn;
                }
                if (i == 5)
                {
                    label6Playername.Text = listofplayers.players[i].namn;
                }
                if (i == 6)
                {
                    label7Playername.Text = listofplayers.players[i].namn;
                }
                if (i == 7)
                {
                    label8Playername.Text = listofplayers.players[i].namn;
                }
                if (i == 8)
                {
                    label9playername.Text = listofplayers.players[i].namn;
                }
                if (i == 9)
                {
                    label10Playername.Text = listofplayers.players[i].namn;
                }

            }
        }
        public void TimeLabels(ListofPlayer listofplayers)
        {
            
            for (int i = 0; i < listofplayers.players.Count; i++)
            {
                string str = "";
                if (i == 0)
                {
                    str += listofplayers.players[i].minutes.ToString();
                    str += ":";
                    if (listofplayers.players[i].seconds < 10)
                    {
                        str += "0";
                    }
                    str += listofplayers.players[i].seconds.ToString();
                    label1.Text = str;
                }
                if (i == 1)
                {
                    str += listofplayers.players[i].minutes.ToString();
                    str += ":";
                    if (listofplayers.players[i].seconds < 10)
                    {
                        str += "0";
                    }
                    str += listofplayers.players[i].seconds.ToString();
                    label2.Text = str;
                }
                if (i == 2)
                {
                    str += listofplayers.players[i].minutes.ToString();
                    str += ":";
                    if (listofplayers.players[i].seconds < 10)
                    {
                        str += "0";
                    }
                    str += listofplayers.players[i].seconds.ToString();
                    label3.Text = str;
                }
                if (i == 3)
                {
                    str += listofplayers.players[i].minutes.ToString();
                    str += ":";
                    if (listofplayers.players[i].seconds < 10)
                    {
                        str += "0";
                    }
                    str += listofplayers.players[i].seconds.ToString();
                    label4.Text = str;
                }
                if (i == 4)
                {
                    str += listofplayers.players[i].minutes.ToString();
                    str += ":";
                    if (listofplayers.players[i].seconds < 10)
                    {
                        str += "0";
                    }
                    str += listofplayers.players[i].seconds.ToString();
                    label5.Text = str;
                }
                if (i == 5)
                {
                    str += listofplayers.players[i].minutes.ToString();
                    str += ":";
                    if (listofplayers.players[i].seconds < 10)
                    {
                        str += "0";
                    }
                    str += listofplayers.players[i].seconds.ToString();
                    label6.Text = str;
                }
                if (i == 6)
                {
                    str += listofplayers.players[i].minutes.ToString();
                    str += ":";
                    if (listofplayers.players[i].seconds < 10)
                    {
                        str += "0";
                    }
                    str += listofplayers.players[i].seconds.ToString();
                    label7.Text = str;
                }
                if (i == 7)
                {
                    str += listofplayers.players[i].minutes.ToString();
                    str += ":";
                    if (listofplayers.players[i].seconds < 10)
                    {
                        str += "0";
                    }
                    str += listofplayers.players[i].seconds.ToString();
                    label8.Text = str;
                }
                if (i == 8)
                {
                    str += listofplayers.players[i].minutes.ToString();
                    str += ":";
                    if (listofplayers.players[i].seconds < 10)
                    {
                        str += "0";
                    }
                    str += listofplayers.players[i].seconds.ToString();
                    label9.Text = str;
                }
                if (i == 9)
                {
                    str += listofplayers.players[i].minutes.ToString();
                    str += ":";
                    if (listofplayers.players[i].seconds < 10)
                    {
                        str += "0";
                    }
                    str += listofplayers.players[i].seconds.ToString();
                    label10.Text = str;
                }

            }
        }
    }
}
